<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>关键帧动画-逐帧动画案例</title>
    <style>
        div{
            width: 400px;
            height: 400px;
            background: url("img/1.jpg") no-repeat;
            background-size: cover;
            /* 1: 使用一次变化; end:看不到最后一帧; start:看不到开始一帧 steps(1, end)等价于step-end*/
            animation: run 5s steps(1, end) infinite;
        }
        @keyframes run {
            0%{
                background: url("img/1.jpg") no-repeat;
                background-size: cover;
            }
            25%{
                background: url("img/2.jpg") no-repeat;
                background-size: cover;
            }
            50%{
                background: url("img/3.jpg") no-repeat;
                background-size: cover;
            }
            75%{
                background: url("img/4.jpg") no-repeat;
                background-size: cover;
            }
            100%{
                background: url("img/1.jpg") no-repeat;
                background-size: cover;
            }
        }
    </style>
</head>
<body>
    <div></div>
</body>
</html>